define(function(require){
	var $ = require("jquery");
	var justep = require("$UI/system/lib/justep");
    var page=1;
	var Model = function(){
		this.callParent();
	};
   
     var quxiao=function(){
       $('#wxloading').css("display","none");
    }
	Model.prototype.modelParamsReceive = function(event){
      zuoti = this.comp("zhuanjia");
         zuoti.clear();
         $.ajax({
               type: "GET",
               url: window.yuming+'/app/expertinfo/ten/'+page,     
               async: false,
               cache: false,
               success: function(datas){
                     // var obj = JSON.parse(datas);  
                       $.each(datas,function(i,n){
                      var zuotis = {
                      defaultValues : [
                       {
                       "id" :n.id,
                       "img" : window.imgshou+n.headerUrl,
                       "name" :n.name,
                       "leixing" :n.address,
                       "jieshao" :n.expertise,
                       "zhenduan":n.dealingProblems,
                       "zhuangtai":n.status,
                       "uid" :n.uid,
                       "xiang" :n.personal
                       }
                       ]
                       };
                       zuoti.newData(zuotis);
                       })
                
       
               }
        })
	};

	Model.prototype.scrollView1PullUp = function(event){
      /*  page=page+10;
       zuoti = this.comp("zhuanjia");
         $.ajax({
               type: "GET",
               url: 'http://'+window.yuming+'/app/expertinfo/ten/'+page,     
               async: false,
               cache: false,
               success: function(datas){
                     // var obj = JSON.parse(datas);  
                       $.each(datas,function(i,n){
                      var zuotis = {
                      defaultValues : [
                       {"id" :n.id,
                       "img" :'http://'+window.imgshou+n.headerUrl,
                       "name" :n.name,
                       "leixing" :n.address,
                       "jieshao" :n.expertise,
                       "zhenduan":n.dealingProblems,
                       "zhuangtai":n.status,
                       "uid" :n.uid,
                       "xiang" :n.personal
                       }
                       ]
                       };
                       zuoti.newData(zuotis);
                       })
                
       
               }
        })*/
	};

	Model.prototype.mediaLeft1Click = function(event){
	   var row=event.bindingContext.$object;
       this.comp("windowDialog1").open({
        params:{
              rowdata:row.toJson()
        }     
       });
	};

	Model.prototype.button1Click = function(event){
	var row=event.bindingContext.$object;
	var uid=row.toJson();
	
    this.shipin(uid,localStorage.token);
   	
	};
    Model.prototype.shipin=function(h,t){
     
    $.ajax({
        type: "GET",
        url: window.yuming+'/videoconnects/vc/?eid='+h+'&login-token'+t,     
        async: false,
        cache: false,
   
        success: function(datas){
              alert(datas.url);
             //location.href=datas.url+datas.roomid;
            },
        error: function(XMLHttpRequest){
        
         
        }
    });
    }
    //弹出填写资料输入框
    Model.prototype.button3Click = function(event){
	  
       var row=event.bindingContext.$object;
        // console.log(row.toJson())
       this.comp("wdEmptym").open({
        params:{
              rowdata:row.toJson()
        }     
       });  
	};
	return Model;
});